#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;

const int max_len = 256 + 10;

struct Node {
  bool have_value;
  int value;
  Node *left_child, *right_child;
  
  Node():have_value(false),left_child(NULL),right_child(NULL){}
};

char input_string[max_len];
Node* root;
bool is_failed;

Node* create_node() {
  return new Node();
}

void add_node(int value, char* str) {
  int len = strlen(str);
  Node *u = root;
  for (int i = 0; i < len; i++) {
    if (str[i] == 'L') {
      if (u->left_child == NULL) {
        u->left_child = create_node();
      }
      u = u->left_child;
    }
    else if (str[i] == 'R') {
      if (u->right_child == NULL) {
        u->right_child = create_node();
      }
      u = u->right_child;
    }
  }
  if (u->have_value) {
    is_failed = true;
  }
  u->value = value;
  u->have_value = true;
}

void delete_tree(Node* u) {
  if (u == NULL) {
    return;
  }
  delete_tree(u->left_child);
  delete_tree(u->right_child);
  delete u;
}

bool read_input() {
  is_failed = false;
  delete_tree(root);
  root = create_node();
  while (true) {
    if (scanf("%s", input_string) != 1) {
      return false;
    }
    if (strcmp(input_string, "()") == 0) {
      break;
    }
    int value;
    sscanf(&input_string[1], "%d", &value);
    add_node(value, strchr(input_string, ',') + 1);
  }
  return true;
}

bool bfs(vector<int> &level_order_value) {
  level_order_value.clear();
  queue<Node*> q;
  q.push(root);
  while (!q.empty()) {
    Node *u = q.front();
    q.pop();
    if (!u->have_value) {
      return false;
    }
    level_order_value.push_back(u->value);
    if (u->left_child != NULL) {
      q.push(u->left_child);
    }
    if (u->right_child != NULL) {
      q.push(u->right_child);
    }
  }
  return true;
}

int main() {
  vector<int> level_order_value;
  while (read_input()) {
    if (!bfs(level_order_value)) {
      is_failed = true;
    }
    
    if (is_failed) {
      printf("not complete\n");
    }
    else {
      for (int i = 0, size = level_order_value.size(); i < size; i++) {
        printf("%d", level_order_value[i]);
        if (i != (size - 1)) {
          printf(" ");
        }
      }
      printf("\n");
    }
  }
  
  return 0;
}
